/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package swingDemoEvent;

import java.awt.*;
import java.awt.event.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;

public class ActionEventTest3 extends JFrame {
    JTextField t1 = new JTextField("abc");
    JButton b1 = new JButton("change");
    JButton b2 = new JButton("exit");
    public ActionEventTest3() {
        setLayout(new FlowLayout());
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        b1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                t1.setText("农大");
                t1.setFont(new Font("黑体", Font.ITALIC, 20));
                t1.setSize(100, 50);
                t1.setForeground(Color.red);
                t1.setSize(50, 100);
            }
        });

        setSize(300, 300);
        setVisible(true);
        add(b1);
        add(b2);
        add(t1);
        
    }

    public static void main(String[] args) {
        ActionEventTest3 ic = new ActionEventTest3();
    }
}
